from Libs import MysqlModel


class ZhifubaoSoup():

    @staticmethod
    def select():
        MysqlApi = MysqlModel.mysql()
        data = MysqlApi.select("select * from zhifubao_soup ")

        print(data)

    @staticmethod
    def insert(data):
        MysqlApi = MysqlModel.mysql()

        print(data)
        # SQL 插入语句
        sql = "INSERT INTO zhifubao_soup(`交易号`,  `商家订单号`, `交易创建时间`, `付款时间`, `最近修改时间`, `交易来源地`, " \
              "`类型`, `交易对方`,`商品名称`, `金额（元）`, `收/支`, `交易状态`, " \
              "`服务费`, `成功退款`, `备注`, `资金状态`,  `f17`) " \
              "VALUES ('%s', '%s', '%s', '%s', '%s' , '%s' ," \
              "'%s', '%s', '%s', '%s', '%s' , '%s', " \
              "'%s', '%s', '%s', '%s' , '%s' )" % (data[0], data[1], data[2], data[3], data[4], data[5],
                                         data[6], data[7], data[8], data[9], data[10], data[11],
                                         data[12], data[13], data[14], data[15], data[16])

        # print(sql)
        MysqlApi.insert(sql)

    @staticmethod
    def delete():
        MysqlApi = MysqlModel.mysql()

        # SQL 插入语句
        sql = "DELETE FROM EMPLOYEE WHERE AGE = %s" % (20)

        MysqlApi.insert(sql)
